package com.hmall.common.client;

import cn.hutool.json.JSON;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.pojo.Item;
import com.hmall.common.pojo.RequestParams;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Author mr.ma
 * @Date 2024/11/22 10:44
 */
@FeignClient(value = "itemservice")
public interface SearchClient {

    @PostMapping("/item/filters")
    JSON filters(@RequestBody RequestParams requestParams);

    @PostMapping("/list")
    PageDTO list(@RequestBody RequestParams requestParams);

    @GetMapping("/{id}")
    public Item getById(@PathVariable Long id);

    @PutMapping("/item/stock/{itemId}/{num}")
    public void changes(@PathVariable Long itemId,@PathVariable Integer num);

    @PutMapping("/item/stock1/{itemId}/{num}")
    public void changes1(@PathVariable Long itemId,@PathVariable Integer num);
}
